package LeetCode;

public class LC_392_IsSubsequence {

    public static void main(String[] args) {

    }

    public class Solution {
        public boolean isSubsequence(String s, String t) {
            int sLength = s.length();
            int tLength = t.length();
            int sIndex = 0;
            int tIndex = 0;
            while (tIndex < tLength) {
                if (sIndex < sLength && (s.charAt(sIndex) == t.charAt(tIndex))) sIndex++;
                tIndex++;
            }
            return sIndex == sLength;
        }
    }
}